Skip to content

[staging] python313Packages.pyzmq: disable flaky tests#367255

Merged
emilazy merged 1 commit intoNixOS:stagingfrom
paparodeo:pyzmq-disable-flaky-tests
Jan 3, 2025
Merged

[staging] python313Packages.pyzmq: disable flaky tests#367255
emilazy merged 1 commit intoNixOS:stagingfrom
paparodeo:pyzmq-disable-flaky-tests

Conversation

@paparodeo
Copy link
Contributor

@paparodeo paparodeo commented Dec 22, 2024

3 tests are marked as flaky and fail periodically on hydra, disable them. Alternatively, adding pytest-rerunfailures package will enable the tests to be rerun (they are marked as rerun=3) but just disable them all together.

before:
collected 364 items / 81 deselected / 1 skipped / 283 selected
after:
collected 364 items / 84 deselected / 1 skipped / 280 selected

https://github.com/pytest-dev/pytest-rerunfailures

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Dec 22, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. labels Dec 22, 2024
Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Dec 30, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this will work with structured attributes (#347194); might need pytestFlagsArray+=(-m 'not flaky') in a Bash phase? cc @ShamrockLee

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a pretty common pattern in the python modules. tho I can probably write it as [ "-m" "'not flaky'"] which might be more future compatible ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, that worked got:
collected 364 items / 84 deselected / 1 skipped / 280 selected

which is what it should be when the 3 flaky tests are disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tho when I add __structuredAttrs = true; both revisions have the same result -- 3 flaky tests are disabled so perhaps it just doesn't matter.

Copy link
Contributor

@ShamrockLee ShamrockLee Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#347194 will leave pytestFlagsArray as is and introduce pytestFlags as the new, conforming interface. (The pytestFlags version will be pytestFlags = [ "-m" "not flaky" ];, and will require __structuredAttrs = true to keep the spaced argument from splitting.)

Due to historical reasons, pytestFlagsArray are string-concatenated and Bash-evaluated before appending to the command. Unfortunately, specifying it as a Bash array doesn't prevent such Bash-evaluating behaviour.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it’s fine for now then; migrating off the broken pytestFlagsArray semantics is a task for another time.

3 tests are marked as flaky and fail periodically on hydra, disable
them. Alternatively, adding pytest-rerunfailures package will enable the
tests to be rerun (they are marked as `rerun=3`) but just disable them
all together.

before:
collected 364 items / 81 deselected / 1 skipped / 283 selected
after:
collected 364 items / 84 deselected / 1 skipped / 280 selected

https://github.com/pytest-dev/pytest-rerunfailures
https://cache.nixos.org/log/ja0w2jni5qzlgrzp2sjl67rcjzrxxz0r-python3.13-pyzmq-26.2.0.drv
@github-actions github-actions bot removed 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Jan 3, 2025
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 3, 2025
@emilazy emilazy merged commit 3369d54 into NixOS:staging Jan 3, 2025
@paparodeo paparodeo deleted the pyzmq-disable-flaky-tests branch January 3, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants